package com.example.chamberlainserver.dto;

import javax.validation.constraints.*;

/**
 * 辅导员数据传输对象
 */
public class CounselorDTO {

    @NotBlank(message = "姓名不能为空")
    @Size(max = 50, message = "姓名长度不能超过50个字符")
    private String name;

    @NotBlank(message = "工号不能为空")
    @Size(max = 20, message = "工号长度不能超过20个字符")
    private String employeeId;

    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @Email(message = "邮箱格式不正确")
    @Size(max = 100, message = "邮箱长度不能超过100个字符")
    private String email;

    @Size(max = 200, message = "办公地点长度不能超过200个字符")
    private String officeLocation;

    @Size(max = 100, message = "部门长度不能超过100个字符")
    private String department;

    @Size(max = 50, message = "职称长度不能超过50个字符")
    private String title;

    @Min(value = 0, message = "状态值不能小于0")
    @Max(value = 2, message = "状态值不能大于2")
    private Integer status; // 0-停用 1-正常 2-休假

    @Size(max = 500, message = "权限长度不能超过500个字符")
    private String permissions;

    @Size(max = 255, message = "头像URL长度不能超过255个字符")
    private String avatar;

    @Size(max = 500, message = "备注长度不能超过500个字符")
    private String remarks;

    // 构造函数
    public CounselorDTO() {}

    public CounselorDTO(String name, String employeeId, String phone, String email, 
                       String officeLocation, String department, String title, 
                       Integer status, String permissions, String avatar, String remarks) {
        this.name = name;
        this.employeeId = employeeId;
        this.phone = phone;
        this.email = email;
        this.officeLocation = officeLocation;
        this.department = department;
        this.title = title;
        this.status = status;
        this.permissions = permissions;
        this.avatar = avatar;
        this.remarks = remarks;
    }

    // Getter 和 Setter 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getOfficeLocation() {
        return officeLocation;
    }

    public void setOfficeLocation(String officeLocation) {
        this.officeLocation = officeLocation;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getPermissions() {
        return permissions;
    }

    public void setPermissions(String permissions) {
        this.permissions = permissions;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    @Override
    public String toString() {
        return "CounselorDTO{" +
                "name='" + name + '\'' +
                ", employeeId='" + employeeId + '\'' +
                ", phone='" + phone + '\'' +
                ", email='" + email + '\'' +
                ", officeLocation='" + officeLocation + '\'' +
                ", department='" + department + '\'' +
                ", title='" + title + '\'' +
                ", status=" + status +
                ", permissions='" + permissions + '\'' +
                ", avatar='" + avatar + '\'' +
                ", remarks='" + remarks + '\'' +
                '}';
    }
}